package org.unit.testmgmt.ui.actions;

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ui.IActionDelegate;
import org.unit.testmgmt.messages.Messages;

/**
 * The action for the test suite generation.
 * 
 * @author Robert Streng
 *
 */
public class GenerateUnitTestSuiteAction extends UTMAction {

	/**
	 * Constructor
	 */
	public GenerateUnitTestSuiteAction() {
		super();
	}

	/**
	 * @see IActionDelegate#run(IAction)
	 */
	public void run(IAction action) {
		

		try {
			boolean result = getUTMController() == null;
			if (result) {
				MessageDialog.openInformation(shell, Messages.General_information, Messages.General_info_generation_successful);
			}
		}
		catch (Exception e) {
			MessageDialog.openError(shell, Messages.General_error, e.getMessage());
		}

	}

}
